var list_ul1 = $("#list-ul1");
var list_ul2 = $("#list-ul2");
var list_ul3 = $("#list-ul3");
var list_ul4 = $("#list-ul4");
var list_ul5 = $("#list-ul5");
$.ajax("./libs/active.json")
.then(function(res){
    var list = res.data;
    var html = list.map(function(item){
        return `<li>
        <a href="###"><img data-src="${item.image}" alt=""></a>
        <a href="###" class="title">${item.title}</a>
        <p>${item.intro}</p>
        <span><b>￥</b>${item.price}</span>
        <a href="###" class="buy">立即购买</a>
    </li>`;
    }).join("");
    list_ul1.html(html);


    var list2 = res.data2;
    var html2 = list2.map(function(item){
        return `<li>
        <a href="###"><img data-src="${item.image2}" alt=""></a>
        <a href="###" class="title">${item.title2}</a>
        <p>${item.intro2}</p>
        <span><b>￥</b>${item.price2}</span>
        <a href="###" class="buy">立即购买</a>
    </li>`;
    }).join("");
    list_ul2.html(html2);



    var list3 = res.data3;
    var html3 = list3.map(function(item){
        return `<li>
        <a href="###"><img data-src="${item.image3}" alt=""></a>
        <a href="###" class="title">${item.title3}</a>
        <p>${item.intro3}</p>
        <span><b>￥</b>${item.price3}</span>
        <a href="###" class="buy">立即购买</a>
    </li>`;
    }).join("");
    list_ul3.html(html3);


    var list4 = res.data4;
    var html4 = list4.map(function(item){
        return `<li>
        <a href="###"><img data-src="${item.image4}" alt=""></a>
        <a href="###" class="title">${item.title4}</a>
        <p>${item.intro4}</p>
        <span><b>￥</b>${item.price4}</span>
        <a href="###" class="buy">立即购买</a>
    </li>`;
    }).join("");
    list_ul4.html(html4);


    var list5 = res.data5;
    var html5 = list5.map(function(item){
        return `<li>
        <a href="###"><img data-src="${item.image4}" alt=""></a>
        <a href="###" class="title">${item.title4}</a>
        <p>${item.intro4}</p>
        <span><b>￥</b>${item.price4}</span>
        <a href="###" class="buy">立即购买</a>
    </li>`;
    }).join("");
    list_ul5.html(html5);

    $(".section").find("img").lazyload();
})


